home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10399 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: fflush and Visual C++
  5. Date: Sun, 17 Mar 1996 16:18:40 GMT
  6. Organization: Netcom
  7. Message-ID: <314c3a5f.145588955@nntp.ix.netcom.com>
  8. References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com>
  9. NNTP-Posting-Host: ix-dc12-26.ix.netcom.com
  10. X-NETCOM-Date: Sun Mar 17  8:18:40 AM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. seebs@solutions.solon.com (Peter Seebach) wrote:
  14.  
  15. > In article <314b173b.71056173@nntp.ix.netcom.com>,
  16. > Mike Rubenstein <miker3@ix.netcom.com> wrote:
  17. > >Perhaps because Visual C implements fflush() correctly.  fflush() does
  18. > >not flush input buffers.  fflush() with stdin as an argument results
  19. > >in undefined behavior.
  20. > The first part of this is incorrect.  fflush() may flush input buffers.
  21. > It may cause the program to abort.  It may do nothing.  But there's
  22. > nothing *wrong* with it choosing to discard pending input when invoked
  23. > on an input stream.  Except that it's rude of an implementation to offer
  24. > a silent extension, it causes people to make mistakes.
  25.  
  26. What's incorrect?  Are you claiming that Visual C does not implement
  27. fflush() correctly?
  28.  
  29. And claiming that someone is wrong for saying that a function doesn't
  30. do something when the language definition does not define it as doing
  31. it is rather pedantic.  Sure, it is true (as I point out) that
  32. fflush(stdin) can do anything, but I'd not suggest using it when you
  33. want to format your hard disk -- there are quite a few implementations
  34. that will not do that. :-)
  35.  
  36.  
  37. Michael M Rubenstein
  38.